#ifndef DBRESULT_H
#define DBRESULT_H

#include "global.h"

namespace ZY {

    class DbResult
    {
        public:
            typedef map<string, char* >    FIELD_MAP;
            typedef vector<char* >         FIELD_ARRAY;

            friend class Db;

            DbResult( MYSQL_RES* res ) ;
            virtual ~DbResult();

            bool fetchRow( FIELD_MAP & row) ;
            bool fetchRowArray( FIELD_ARRAY &  row);
        protected:
        private:
            MYSQL_RES * _res;
            vector<string> _fieldName; //列名
            int _max_field_num;        
    };
}
#endif // DBRESULT_H
